<%@ page import="java.util.Date" %>
<%--
  Created by IntelliJ IDEA.
  User: 97416
  Date: 2022/2/6
  Time: 20:52
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%--jsp表达式
作用：将程序的输出，输出到客户端
--%>
<%=new Date()%>
<hr>
<%--
JSP脚本片段
--%>
<%
    int sum = 0;
    for (int i = 0; i < 100; i++) {
        sum += i;
    }
    out.print(sum);
%>
<%--java代码中嵌入html--%>
<%for (int i = 0; i < 5; i++) {%>
<h1>Hello, World<%=i%></h1>
<%
    }
%>
<%--
JSP声明
--%>
<%!
    static {
        System.out.println("loading Servlet");
    }
    private int globalV = 10;
    public void kuang(){
        System.out.println("进入了kuang");
    }
%>


</body>
</html>
